<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header">
</head>

<body class="hold-transition skin-blue sidebar-mini">
<style>
    .table-border tbody tr td{
        border-top: 1px solid black;
    }
</style>
<section class="content-header">
    <h1>
        员工业绩查询
    </h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <form id="queryForm" onsubmit="return false;">
                        <div class="row">
                            <div class="form-inline">
                                <div class="form-group" style="margin-right: 10px;">
                                    <label>员工姓名</label>
                                    <input type="text" name="uname" class="form-control" placeholder="请输入员工姓名">
                                </div>
                                <!--<div class="form-group" style="margin-right: 10px;">-->
                                    <!--<label>工作组</label>-->
                                    <!--<input type="text" name="groupName" class="form-control" placeholder="请输入工作组">-->
                                <!--</div>-->
                                <div class="form-group" style="margin-right: 10px;">
                                    <label>任务名称</label>
                                    <input type="text" name="tname" class="form-control" placeholder="请输入任务名称">
                                </div>
                                <div class="form-group" style="margin-right: 10px;">
                                    <label>项目名称</label>
                                    <input type="text" name="name" class="form-control" placeholder="请输入编号或名称">
                                </div>

                                <!--<div class="form-group" style="margin-right: 10px;">-->
                                    <!--<label>完成时间</label>-->
                                    <!--<input type="text" name="designDepts" class="form-control">-->
                                <!--</div>-->
                                <button type="button" class="btn btn-success" id="btn-search" style="margin-top: 5px;">
                                    <span class="Bold">搜索</span>
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="box-body">
                    <table id="bootstrap-table"  class="table-border" style="table-layout: fixed;word-break:break-all; word-wrap:break-word;"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer">
</div>

<script th:inline="javascript">


    /** 加载用户表格 */
    table = js.table.init({
        url: ctx + "task/userPerformanceSel",
        showColumns: false,
        showExport: false,
        pageSize:300,
        columns: [

            {
                title: '序号', field: 'id', width: '50',
                formatter: function (value, row, index, field) {
                    var pageSize = table.bootstrapTable('getOptions').pageSize;
                    var pageNumber = table.bootstrapTable('getOptions').pageNumber;
                    return pageSize * (pageNumber - 1) + index + 1;
                }
            },
            { title: "员工姓名", field: 'uname'},
            // { title: "工作组", field: 'groupName'},

            { title: "任务名称", field: 'tname'},
            { title: "项目编号", field: 'code'},
            { title: "项目名称", field: 'name'},
            // { title: "备注", field: 'remark'},
            { title: "开始时间", field: 'beginDate',
                formatter: function (value, row, index, field) {
                   if(value=="1900-01-01"){
                       return "";
                   }else{
                       return value;
                   }
                }
            },
            { title: "完成时间", field: 'endDate',
                formatter: function (value, row, index, field) {
                    if(value=="1900-01-01"){
                        return "";
                    }else{
                        return value;
                    }
                }
            },
            { title: "历时（天）", field: 'useDay',
                formatter: function (value, row, index, field) {
                    if(row.beginDate=="1900-01-01" || row.beginDate==''){
                        return "";
                    }else if(row.endDate=="1900-01-01" || row.endDate==''){
                        return "";
                    }else{
                        return parseInt(value)+1;
                    }
                }}
        ]
    });
    /**
     * 表格搜索
     */
    $("#btn-search").click(function () {
        js.table.search(table);
    });
    </script>